package com.tstudy.laoshibang.mode;

import java.util.ArrayList;
import java.util.List;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;


/**
 * Created by jiaojian on 2014/12/20.
 */
@DatabaseTable
public class City implements BaseModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8671620325107026574L;
	@DatabaseField(id = true)
	private int cityId = -1;
	@DatabaseField
    private String type;
	@DatabaseField
    private String cityName;
	@DatabaseField
    private int parentProvinceId;
	@DatabaseField
    private int parentCityId;
	
	public List<City> subList = new ArrayList<City>();

    public City(String type, int cityId, String cityName, int parentProvinceId, int parentCityId) {
        this.type = type;
        this.cityId = cityId;
        this.cityName = cityName;
        this.parentProvinceId = parentProvinceId;
        this.parentCityId = parentCityId;
    }

    public City() {
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getParentProvinceId() {
        return parentProvinceId;
    }

    public void setParentProvinceId(int parentProvinceId) {
        this.parentProvinceId = parentProvinceId;
    }

    public int getParentCityId() {
        return parentCityId;
    }

    public void setParentCityId(int parentCityId) {
        this.parentCityId = parentCityId;
    }

    @Override
    public boolean equals(Object o) {
        return cityId == (((City) o).getCityId());
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    @Override
    public String toString() {
        return cityName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
}
